package com.xuanxu.blogs.framework.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *  博客系统常用 http 状态枚举对象
 * @author XuanXu
 * @version 1.0
 * @date 2024-08-18 21:46
 */
@Getter
@AllArgsConstructor
public enum HttpStatusEnum {

    /**
     * 成功
     */
    SUCCESS(200, "请求成功！"),

    /**
     * 服务端错误
     */
    UNAUTHORIZED(401, "账号未登录！"),
    FORBIDDEN(403, "没有该操作权限！"),
    NOT_FOUND(404, "请求未找到！"),
    METHOD_NOT_ALLOWED(405, "请求方法不正确！"),
    LOCKED(423, "请求失败，请稍后重试！"),
    TOO_MANY_REQUESTS(429, "请求过于频繁，请稍后重试！"),
    MISS_REQUEST_PARAMETER(430, "请求参数缺失！"),

    /**
     * 客户端错误
     */
    INTERNAL_SERVER_ERROR(500, "系统异常！"),
    NOT_IMPLEMENTED(501, "功能未实现/未开启！"),
    ERROR_CONFIGURATION(502, "错误的配置项！"),
    REPEATED_REQUESTS(900, "重复请求，请稍后重试！"),

    /**
     * 其他错误
     */
    DEMO_DENY(901, "演示模式，禁止写操作！"),
    UNKNOWN(999, "未知错误！"),

    ;


    private final Integer status;
    private final String message;
}
